<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <script type="text/javascript" src="../../zxt/zxt.js">
        </script>
        <script>
            importZXT("../../zxt");
        </script>
        <script>
            $zxt.replaceContainer = false;
        </script>
    </head>
    <body>
        <div style="width:80%;">
            <div id="fieldset_up" zxt="zxt.ui.Fieldset" zxt.configFunc="configRegion" zxt.width="600px" zxt.folded="true" zxt.title="卡片信息1">
                <p>
                    A cold wave sweeping across large swathes of China since Saturday has forced some provinces to ration electricity for industrial use, but State power company officials promised yesterday that supply to residents across those regions would not be affected. 
                </p>
                <p>
                    Regions across east and central China have resorted to rationing of power for industry to tide over the icy weather that has pushed up energy demand while disrupting coal transportation. 
                </p>
                <p>
                    Cities in eastern coastal regions such as Jiangsu and Zhejiang, two economic hubs, have so far not resorted to power cuts to industry but local authorities did not rule out the possibility should the necessity arise. 
                </p>
                <p>
                    Shanghai Grid confirmed that power in Shanghai will not be switched off or rationed in the next couple of days. 
                </p>
                <p>
                    A researcher noted that the power shortage won't last long since it's caused mainly by the abnormal weather.
                </p>
            </div>
            <div id="fieldset_down" zxt="zxt.ui.Fieldset" zxt.width="300px" zxt.title="卡片信息2" zxt.fixed="true">
                <p>
                    A cold wave sweeping across large swathes of China since Saturday has forced some provinces to ration electricity for industrial use, but State power company officials promised yesterday that supply to residents across those regions would not be affected. 
                </p>
                <p>
                    Regions across east and central China have resorted to rationing of power for industry to tide over the icy weather that has pushed up energy demand while disrupting coal transportation. 
                </p>
                <p>
                    Cities in eastern coastal regions such as Jiangsu and Zhejiang, two economic hubs, have so far not resorted to power cuts to industry but local authorities did not rule out the possibility should the necessity arise. 
                </p>
            </div>
        </div>
        <table>
        	<tr>
				<td>getType()</td>
				<td>返回按钮的控件类型</td>
				<td><input type="button" name="getType" value="getType" 
					onclick="alert('第一个FieldSet的type为'+$zxtUI.fieldset_up.getType());"/></td>
			</tr>
			<tr>
				<td>addElement(elem)</td>
				<td>插入传入的DOM元素</td>
				<td><input type="button" name="addElement" value="addElement" 
					onclick="$zxtUI.fieldset_down.addElement('<div>addElement</div>');alert('第二个FieldSet增加了dom节点');"/></td>
			</tr>
			<tr>
				<td>addWidget(widget)</td>
				<td>向内部添加widget控件。</td>
				<td><input type="button" name="addWidget" value="addWidget" 
					onclick="var btn = new zxt.ui.Button('edit1', 'EDIT1');btn.onClick = function(){alert('HA');};$zxtUI.fieldset_down.addWidget(btn);alert('第二个FieldSet增加了控件');"/></td>
			</tr>
			<tr>
				<td>closeFieldset()</td>
				<td>折叠区域控件。</td>
				<td><input type="button" name="closeFieldset" value="closeFieldset" 
					onclick="$zxtUI.fieldset_up.closeFieldset();alert('第一个FieldSet折叠了');"/></td>
			</tr>
			<tr>
				<td>openFieldset()</td>
				<td>展开区域控件。</td>
				<td><input type="button" name="openFieldset" value="openFieldset" 
					onclick="$zxtUI.fieldset_up.openFieldset();alert('第一个FieldSet展开了');"/></td>
			</tr>
        </table>
        <div><a href="../index.html">返回</a></div>
    </body>
</html>
<script type="text/javascript">
    
    $zxt.init();
    
    function configRegion(region){
        var btn = new zxt.ui.Button("edit", "EDIT");
        btn.onClick = function(){
            alert("HA");
        }
        region.addWidget(btn);
    }
</script>
